package com.tceasy.gateway;

/**
 * Created by zhanghuan on 2016/4/12.
 * 常量
 */
public class Constants {
    public final static String USER_IN_SESSION = "user_in_session";
    /*忽略静态格式的过滤*/
    private final static String[] ignoreFormat=new String[]{"css","jpg","png","gif","ico","js","html","ttf","woff","eot","svg","yml","md","less","json"};

    /*redis缓存key前缀*/
    public final static String redisPrefx="api:gateway";

    public static boolean isIgnore(String path){
        /*登陆无需过滤*/
        if(path.indexOf("/login.jsp")>-1||path.endsWith("/login/login")){
            return true;
        }
        /*静态文件无需过滤*/
        for(String white:ignoreFormat){
            if(path.endsWith(white)){
                return true;
            }
        }

        return false;
    }



}
